home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
ai
/
gaf200b
/
example
/
heattank.x02
< prev
next >
Wrap
Text File
|
1994-09-27
|
3KB
|
103 lines
!--------------------------------------------------------
! Water tank heat control
! Assume constant volume (i.e. water in = water out)
!--------------------------------------------------------
CONFIGURATION
PLOT_DURATION = 250.0; ! seconds
SIM_SCHEDULE_RATE = 1; ! second
SIM_INC_RATE = 0.2; ! second
END_CONFIGURATION;
SEGMENT TempControl
CYCLE_TIME 1.0
! Name MIN MAX
IN Temperature(32.0, 212.0)
IN Water_out (0.0, 1.0)
IN Temp_error (-180.0, 180.0)
IN Heating (0, 1)
OUT Gas_valve (0.0, 10.0)
ENABLE = Heating;
Initialization
Gas_valve = 0;
END;
! Name Below Low High Above Truth
Symbol Zero OF Water_out ( 0.0, 0.0, 0.0, 0.2, 1.0)
Symbol Light OF Water_out ( 0.0, 0.2, 0.2, 0.4, 1.0)
Symbol Medium OF Water_out ( 0.2, 0.4, 0.4, 0.6, 1.0)
Symbol Heavy OF Water_out ( 0.4, 0.6, 0.6, 0.8, 1.0)
Symbol VeryHeavy OF Water_out ( 0.6, 0.8, 1.0, 1.0, 1.0)
! Name Below Low High Above Truth
Symbol VeryCold OF Temp_error(-180.0, -180.0, -40.0, -20.0, 1.0)
Symbol Cold OF Temp_error( -40.0, -20.0, -20.0, 0.0, 1.0)
Symbol OnTarget OF Temp_error( -20.0, 0.0, 0.0, 20.0, 1.0)
Symbol Hot OF Temp_error( 0.0, 20.0, 20.0, 40.0, 1.0)
Symbol VeryHot OF Temp_error( 20.0, 40.0, 180.0, 180.0, 1.0)
! Name Below Low High Above Truth Center
Symbol Off OF Gas_valve ( 0.0, 0.0, 0.0, 2.0, 1.0, 0.0)
Symbol VeryLow OF Gas_valve ( 0.0, 2.0, 2.0, 4.0, 1.0)
Symbol Low OF Gas_valve ( 2.0, 4.0, 4.0, 6.0, 1.0)
Symbol High OF Gas_valve ( 4.0, 6.0, 6.0, 8.0, 1.0)
Symbol VeryHigh OF Gas_valve ( 6.0, 8.0, 10.0, 10.0, 1.0, 10.0)
!!!!!!!! Rules for controlling Gas_valve
! VeryHeavy Heavy Medium Light Zero
!---------------------------------------------------
! VeryCold VH VH VH VH VH
! Cold VH,VH VH VH VH VH
! OnTarget VH VH,L L VL Off
! Hot VH,L VH,VL VL Off Off
! VeryHot VH,Off Vh,Off Off Off Off
!
!
IF Temp_error IS VeryCold
THEN Gas_valve IS VeryHigh
IF Temp_error IS Cold
THEN Gas_valve IS VeryHigh
IF Temp_error IS OnTarget AND Water_out IS Heavy
THEN Gas_valve IS Low
IF Temp_error IS OnTarget AND Water_out IS Medium
THEN Gas_valve IS Low
IF Temp_error IS OnTarget AND Water_out IS Light
THEN Gas_valve IS VeryLow
IF Temp_error IS OnTarget AND Water_out IS Zero
THEN Gas_valve IS Off ! ExtLow
IF Temp_error IS Hot AND Water_out IS VeryHeavy
THEN Gas_valve IS Low
IF Temp_error IS Hot AND Water_out IS Heavy
THEN Gas_valve IS VeryLow
IF Temp_error IS Hot AND Water_out IS Medium
THEN Gas_valve IS VeryLow
IF Temp_error IS Hot AND Water_out IS Light
THEN Gas_valve IS Off
IF Temp_error IS Hot AND Water_out IS Zero
THEN Gas_valve IS Off
IF Temp_error IS VeryHot
THEN Gas_valve IS Off
IF Water_out IS VeryHeavy
THEN Gas_valve IS VeryHigh
IF Water_out IS Heavy
THEN Gas_valve IS VeryHigh
END TempControl;